package com.conan.method.args;/** * @version 加油！！！ * @Description * @Author 谷藤新一GYC * @Date 2023/8/6-8:38 */public class StringConCatTest {    public static void main(String[] args) {        StringConCatTest s1 = new StringConCatTest();        System.out.println(s1.concat("-", "hello", "world", "你好"));        System.out.println(s1.concat("-", "hello"));    }    public String concat(String operator,String ... strs){        StringBuilder result = new StringBuilder();        for (int i = 0; i < strs.length; i++) {            if(i == 0){                result.append(strs[i]);            }else {                result.append(operator).append(strs[i]);            }        }        return result.toString();    }}   